<template>
  <div>
    <el-container class="home-container">
      <!-- 头部区域 -->
      <el-header>
        <div>
          <img src="../../assets/heima.png" alt="">
          <span>电商管理系统</span>
        </div>
        <button class="logout" @click="logout">退出</button>
      </el-header>
      <!-- 页面主体区 -->
      <el-container>
        <!-- 侧边栏 -->
        <el-aside width="auto">
          <MyAside></MyAside>
        </el-aside>
        <!-- 主体 -->
        <el-main>
          <!-- 路由占位符 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
  import MyAside from '@/components/MyAside/MyAside.vue'
  export default {
    name: 'MyHome',
    components: {
      MyAside
    },
    data() {
      return {}
    },
    methods: {
      logout() {
        window.sessionStorage.clear()
        this.$router.push('/login')
      }
    }
  }

</script>
<style lang="less" scoped>
  .home-container {
    height: 100vh;
  }

  .el-header {
    background-color: #373d41;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;

    >div {
      display: flex;
      align-items: center;

      span {
        margin-left: 10px
      }
    }
  }

  .el-aside {
    background-color: #333744;
    text-align: center;
    line-height: 200px;
    padding-left: 0;

  }

  .el-main {
    background-color: #e9eef3;
    color: #333;
  }

  body>.el-container {
    margin-bottom: 40px;
  }

  .el-container .el-aside {
    line-height: 320px;
  }

</style>
